<?php
	include("_session.php");
	include("_findmsl.php");	
?>
<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
	<META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">  
    <title>TOS-Quick order</title>
    <link href="css/default.css?v=<?php echo date("YmdHis"); ?>" rel="stylesheet" type="text/css" >
    <script src="js/jquery-1.7.1.js?v=<?php echo date("YmdHis"); ?>" type="text/javascript"></script>
    <script src="js/jquery-ui-1.8.20-core.js?v=<?php echo date("YmdHis"); ?>" type="text/javascript"></script>
    <script src="js/form.js?v=<?php echo date("YmdHis"); ?>" type="text/javascript"></script>
</head>
<body>
<?php include("_header.php"); ?>
<form action="_getorder.php" method="POST" id="main-form">
    <table>
        <tr>
            <td><?php echo $l_mslno; ?></td>
            <td>
                <input 
                	type="text" class="textbox"
                	id="DIST" name="DIST" 
                	maxlength="4" size="4"
                	onkeydown="return validateMember(event, this);"/>-
                <input 
                	type="text" class="textbox" 
                	id="MSLNO" name="MSLNO" 
                	maxlength="5" size="5"
                	onkeydown="return validateMember(event, this);"/>-
                <input 
                	type="text" class="textbox" 
                	id="CHKDGT" name="CHKDGT" 
                	maxlength="1" size="1" 
                	onkeydown="return validateMember(event, this);" />
            </td>
        </tr>
        <tr>
            <td><?php echo $l_membername; ?></td>
            <td>
                <input 
                	type="text" 
                	id="MSLNAME" name="MSLNAME" 
                	readonly="true" class="readonly" /></td>
        </tr>
        <tr>
            <td><?php echo $l_campaign; ?></td>
            <td>
                <select id="ORDCAMP" name="ORDCAMP" class="dropdown" onkeydown="return validateMember(event, this);">
                <?php
                	$sql = "SELECT * FROM tbl008 order by camp";
                	$raw = mysql_query($sql, $conn);                	
                	while ($row = mysql_fetch_array($raw, MYSQL_ASSOC))
                	{                											
                ?>
                    <option value="<?php echo $row["CAMP"]; ?>"
                    	<?php 
                    		if ($row["STATUS"] == "Current") echo "selected=\"true\""; 
                    	?>>
                    <?php echo displayCamp($row["CAMP"]); ?>                    	
                    </option>
                <?php
                	}    
                ?>
                </select></td>
        </tr>
        <tr>
        	<td colspan="2">
        		<input type="button" class="button"
        			id="Order" name="Order" 
        			value="สั่งซื้อสินค้าด่วน" />
        	</td>
        </tr>
    </table>
</form>
</body>
</html>
<script type="text/javascript">
$(document).ready(function () { 
	var btnClick = false;
    $("#DIST").focus();   
    $("input[id^='Order']").click(function () {
    	btnClick = true;
		validateMember(event, $("#CHKDGT"));
		checkMember();		
    });   
    	   
    $('input[class="textbox"]').focusin(function() {
		$("#MSLNAME").val("");
	});
	
	getResponseTime();
});    
</script>
<?php
	include("_close.php");
?>